import sys, os, django
 
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) #把manage.py所在目录添加到系统目录
os.environ['DJANGO_SETTINGS_MODULE'] = 'hg_survey.settings' #设置setting文件
django.setup()#初始化Django环境

import pandas as pd
from students.models import School, College, Major, StudentClass, Student
from students.utils import batch_create_college, batch_create_major, batch_create_student, clean_all

college_file = "college.csv"
major_file = "major.csv"
student_file = "student_class.csv"

if __name__ == '__main__':
    school ="广州城市理工学院"
    clean_all()
    batch_create_college(college_file)
    batch_create_major(major_file, school)
    batch_create_student(student_file, school)
